package com.example.g32.home

import com.example.base.http.ApiServer
import com.example.base.mvi.BaseViewModel
import com.example.base.mvi.RequestType
import com.example.g32.paging.NoticePagingSource
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class HomeVIewModel @Inject constructor(val apiServer: ApiServer):BaseViewModel<HomeIntent>(){
    override fun handlerIntent(it: HomeIntent) {
        when(it){
            is HomeIntent.getNotice->{
               // httpRequest(apiServer.getNotices(it.page,it.size))
                pagingReq ({
                    NoticePagingSource(apiServer)
                })
            }

            is HomeIntent.deleteNotice->{
                //httpRequest(apiServer.getNotices(), RequestType.DELETE)
            }
        }
    }
}